package logger

import (
	"fmt"

	"gitee.com/krio/ginc/example/core/lib/conf"
	"gitee.com/krio/ginc/example/core/lib/logger/zaplog"
	"gitee.com/krio/ginc/example/util/cmdprint"
)

// InitLogger 自定义日志
func InitLogger() {
	logConf := conf.C.Logger
	log := zaplog.NewLogger(
		zaplog.SetLevel(string(logConf.Level)),
		zaplog.SetDebug(logConf.Debug),
		zaplog.SetFilePath(logConf.FilePath),
	)
	zaplog.SetDefault(log)
	cmdprint.CmdSuccess(fmt.Sprintf("日志: %s", conf.C.Logger.Level))
}
